First Steps

Welcome to the First Steps guide on getting started with Progress<sup>®</sup> Telerik<sup>®</sup> UI for ASP.NET Core!

This guide creates a use case scenario which demonstrates how to start working with the suite and implement the Kendo UI DatePicker for ASP.NET Core in your project either with the HtmlHelper or with the TagHelper.

This article shows each step on Windows with Visual Studio 2019.

For using Telerik UI for ASP.NET Core on MacOS, refer to [Getting Started with CLI]({% slug gettingstartedcli_aspnetmvc6_aspnetmvc %}).

Prerequisites

The prerequisites for creating and running an ASP.NET Core on Windows with VS 2019 are described on the .NET Core documentation site.

Configuration

To configure an ASP.NET Core Web Application to use Telerik UI for ASP.NET Core you can either start from scratch and add everything necessary manually or use the The Progress® Telerik® UI for ASP.NET Core Visual Studio Extensions and create a Telerik ASP.NET Core MVC Application that has all the scripts, styles and editor templates

  1. Start from scratch ASP.NET Core Web Application.
  2. Create a sample project with everything in it [Telerik ASP.NET Core MVC Application]({% slug overview_visualstudio_aspnetcore %}).

Create ASP.NET Core Project

  1. Open Visual Studio 2019 and select > Create a New Project.

  2. Select > ASP.NET Core Web Application and click > Next.

    Figure 1. Create an ASP.NET Core MVC application

    Create an ASP.NET Core MVC application

  3. Set a name and location for the project and click Create.

    Figure 2. Select location

    Select location

  4. Select Web Application (Model-View-Controller) and click Create.

    Figure 3. Select a Web Application

    Create an ASP.NET Core MVC application

Add the Telerik UI for ASP.NET Core NuGet Package

  1. Open the NuGet Package Manager.

    Figure 4. The NuGet Package Manager

    NuGet package manager

  2. Add a new package source.

    Figure 5. Add the Telerik NuGet Source

    https://nuget.telerik.com/nuget
    

    NuGet Add Source

  3. Select the Telerik Source from the package source drop-down list and add your credentials as prompted.

    Figure 6. Authenticate using your telerik.com email and password

    NuGet Authenticate

  4. Click the Browse tab and search for Telerik.UI.for.AspNet.Core.

    Figure 7. Select the package and install it

    Select and Install Package

  5. Open Startup.cs file and register the Kendo services in the ConfigureServices method.

        public void ConfigureServices(IServiceCollection services)
        {
            // Add Kendo UI services to the services container
            services.AddKendo();
        }
    
  6. Import the Kendo.Mvc.UI namespace in ~/Views/_ViewImports.cshtml through @using Kendo.Mvc.UI.
    If you intend to use the Kendo UI ASP.NET Core TagHelpers, add them with @addTagHelper *, Kendo.Mvc as well.

         @using MyASPNETCoreProject
         @using MyASPNETCoreProject.Models
         @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
         @addTagHelper *, Kendo.Mvc
         @using Kendo.Mvc.UI
    
  7. Include the client-side resources.

The CDN links and/or package versions have to point to the same UI for ASP.NET Core version which your project references.

The Kendo UI scripts must be placed after jQuery.

    <script src="https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/js/kendo.all.min.js"></script>   
    <script src="https://kendo.cdn.telerik.com/{{ site.mvcCoreVersion }}/js/kendo.aspnetmvc.min.js"></script>               
  1. Use a Kendo UI widget by adding the snippet from the following example to ~/Views/Home/Index.cshtml.

        <div class="text-center">
            <h2>Kendo UI DatePicker</h2>
            @(Html.Kendo().DatePicker()
                .Name("datepicker")
            )
        </div>
    
        <kendo-datepicker name="my-picker"/>
    

    Now that all is done, you can see the sample page.

    Figure 8. The end result—a sample page